package Internal_Anonymity;
/*
 * Description:匿名类简单创建输出演示
 * Author: AMark
 * Date:11/15/2023
 * Time:8:32 AM
 */
class cat{
    String name;
    int age;
    cat(String name, int age) {
        this.age = age;
        this.name = name;
    }
}
public class AnonyDemo {
    public static void main(String[] args) {
        cat littlecat = null;
        new cat("匿名小猫咪", 1) {
            void callname() {
                System.out.println("我的名字是:" + this.name);
            }
        }.callname();

    }
}
